<?php
$this->title = "Sent messages";
$this->headTitle($this->title);
?>	
		
		<!-- start content -->
		<div id="sendmsg_inside" class="content">
			
		<!--  Glavno meni -->
			<div id="InnerMenu">
				<ul>
					<li>
						<a href="<?php echo $this->url(array('controller'=>'Messages','action'=>'createnew'));?>">
						Compose new message</a>
					</li>
					<li>
						<a href="<?php echo $this->url(array('controller'=>'Messages','action'=>'index'));?>">
						Inbox</a>
					</li>
					<li>
						<a href="<?php echo $this->url(array('controller'=>'Messages','action'=>'sentmsg'));?>">
						Sent Messages</a>
					</li>
				</ul> 
			</div>
			<br />
			<div id="outbox">
			
			<table title="Outbox" id="hor-minimalist-a">
				<thead>
				<tr>
					<th>Title</th>
					<th>Sent to</th>
					<th>Time</th>
					<th>&nbsp;</th>
					<th>&nbsp;</th>
				</tr>
				</thead>
			<?php foreach($this->mu as $mes_user) : ?>
				<tbody>
				<tr>
					<td>
						<?php $title = $this->msgs->getMessage((int)$mes_user['Message_id']);
						echo $this->escape($title['Title']);?>
					</td>
					<td>
						<?php $sentto = $this->users->getUser((int)$mes_user['Receiver_id']); 
						echo $this->escape( $sentto['Username'] )." ";
						//echo $this->escape( $sender['last'] );?>
					</td>
					<td>
						<?php $title = $this->msgs->getMessage((int)$mes_user['Message_id']);
						echo $this->escape($title['DateSent']);?>
					</td>
					<td>
						<a href="<?php echo $this->url(array('controller'=>'Messages','action'=>'viewmsg', 'msg_id'=>(int)$mes_user->Message_id));?>">View Message</a>
					</td>
					<td>
						<img alt="<?php echo $mes_user['id']; ?>" src="/med-advisor/application/layouts/scripts/css/Pictures/close.png" id="pic_delete" class="deleteSentMsg">
					</td>

				</tr>
				</tbody>
			<?php endforeach; ?>
			</table>
			
			</div>
		</div>
		<!-- end content -->
		
		

		<div id="pop_upDeleteSentMsg">
			<form id="form_DeleteSentMsg" name="form_DeleteSentMsg" method="post">
				<p>Are you sure that you want to delete this Message?</p>
				
				<input type="submit" name="btn_DeleteSentMsg" id="btn_DeleteSentMsg" value="Yes">
				<input type="button" name="btn_DeleteCancelSentMsg" id="btn_DeleteCancelSentMsg" value="No">
				<input type="hidden" id="hdn_SentMsgCurrentDelete" name="hdn_SentMsgCurrentDelete" value="">
			</form>
		</div>